package cn.flying.cloud.flow.core.listener.enums;

import cn.flying.cloud.flow.core.listener.event.callback.ActivityCompletedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.ActivityStartedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.JobExecutionFailureListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.MultiInstanceActivityStartedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.ProcessCancelledListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.ProcessCompletedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.ProcessCreatedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.ProcessStartedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.TaskAssignedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.TaskCompletedListenerCallback;
import cn.flying.cloud.flow.core.listener.event.callback.TaskCreatedListenerCallback;

/**
 * 事件类型枚举
 *
 * @author: admin
 * @date: 2024年09月19日 20:39
 * @version: 1.0
 */
public enum FlowableEventTypeEnum {
    /**
     * 流程创建
     */
    PROCESS_CREATED("PROCESS_CREATED", ProcessCreatedListenerCallback.class),
    /**
     * 流程开始
     */
    PROCESS_STARTED("PROCESS_STARTED", ProcessStartedListenerCallback.class),
    /**
     * 流程结束
     */
    PROCESS_COMPLETED("PROCESS_COMPLETED", ProcessCompletedListenerCallback.class),
    /**
     * 流程取消
     */
    PROCESS_CANCELLED("PROCESS_CANCELLED", ProcessCancelledListenerCallback.class),
    /**
     * 任务创建
     */
    TASK_CREATED("TASK_CREATED", TaskCreatedListenerCallback.class),
    /**
     * 任务代理分配
     */
    TASK_ASSIGNED("TASK_ASSIGNED", TaskAssignedListenerCallback.class),
    /**
     * 任务完成
     */
    TASK_COMPLETED("TASK_COMPLETED", TaskCompletedListenerCallback.class),
    /**
     * 活动开始
     */
    ACTIVITY_STARTED("ACTIVITY_STARTED", ActivityStartedListenerCallback.class),
    /**
     * 活动完成
     */
    ACTIVITY_COMPLETED("ACTIVITY_COMPLETED", ActivityCompletedListenerCallback.class),
    /**
     * 多实例活动开始
     */
    MULTI_INSTANCE_ACTIVITY_STARTED("MULTI_INSTANCE_ACTIVITY_STARTED", MultiInstanceActivityStartedListenerCallback.class),
    /**
     * 执行异常
     */
    JOB_EXECUTION_FAILURE("JOB_EXECUTION_FAILURE", JobExecutionFailureListenerCallback.class),

    ;

    private String type;
    private Class<?> clazz;

    FlowableEventTypeEnum(String type, Class<?> clazz) {
        this.type = type;
        this.clazz = clazz;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Class<?> getClazz() {
        return clazz;
    }

    public void setClazz(Class<?> clazz) {
        this.clazz = clazz;
    }
}
